Masking of objects in a video stream

ABSTRACT

A method for masking of objects in a video stream, the method comprising: acquiring a video stream; detecting an object in the video stream; determining whether the detected object belongs to a foreground of the video stream indicative of moving objects or to a background of the video stream indicative of static objects; classifying the detected object to be of a specific type using a first classifier if the detected object is determined to belong to the foreground, and using a second classifier if the detected object is determined to belong to the background, the first classifier being different from the second classifier, and if the detected object is classified as being of the specific type of object, masking the object in the video stream.

FIELD OF INVENTION

The present disclosure generally relates to the field of camerasurveillance, and in particular to a method and control unit for maskingof objects in a video stream.

TECHNICAL BACKGROUND

In various camera surveillance applications, it is sometimes necessaryto mask objects in a video stream captured by a camera. Importantreasons for object masking are to ensure privacy for people that show upin the video stream and to protect other types of personal informationthat may be captured in the video stream.

As an example, object detection may be used for detecting vehicles.Masking of the vehicles, or perhaps more importantly, the license platesor people in the vehicle, may be performed by extracting the imagecoordinates of the relevant parts of the object. Once the imagecoordinates are known, the relevant parts in the video stream can bemasked or pixelated.

However, moving objects, such as vehicles, can be difficult to detectwith high reliability, especially at high speeds such as on highways. Insuch cases, object detection and classification risk failing and,consequently, relevant objects risk not being masked.

Accordingly, there is room for improvement regarding masking of objectsin a video stream.

SUMMARY

In view of above-mentioned and other drawbacks of the prior art, thepresent system provides an improved method for masking of objects in avideo stream that alleviates at least some of the drawbacks of priorart.

According to a first aspect, it is therefore provided a method formasking of objects in a video stream.

The method comprises the following steps: acquiring a video stream;detecting an object in the video stream; determining whether thedetected object belongs to a foreground of the video stream indicativeof moving objects or a background of the video stream indicative ofstatic objects; classifying the detected object to be of a specific typeusing a first classifier if the detected object is determined to belongto the foreground, and using a second classifier if the detected objectis determined to belong to the background, the first classifier beingdifferent from the second classifier, and if the detected object isclassified as being of the specific type of object, masking the objectin the video stream.

The present disclosure utilizes different classifiers depending onwhether the object belongs to the foreground or to the background of thevideo stream. The foreground is the part or segment of the video streamthat comprises the moving objects and the background is the part orsegment of the video stream that comprises the static objects. By theprovision of two different classifiers, it is possible to tailor theclassifiers to the different types of characteristics of objects in thedifferent segments, i.e., background or the foreground. More precisely,the first classifier may be specifically configured to performed objectclassification in the foreground and the second classifier may bespecifically configured to performed object classification in thebackground. Thus, the classifiers need not be effective or accurate inthe other one of the background and the foreground.

The method may comprise a step of segmenting the video stream into abackground and a foreground, i.e., into a background segment and aforeground segment. Such segmentation may be performed by extracting thepixel data from pixels in each frame of the video stream that indicatesmoving objects and use that data to construct the foreground. Pixel datafrom pixels in each frame of the video stream that indicates staticobjects are used for constructing the background.

Subsequent to the segmentation it may be determined whether the objectbelongs to the background segment or to the foreground segment, i.e.,whether the object is found or detected in the background segment or inthe foreground segment.

Thus, determining whether the object belongs to the background or to theforeground may comprise segmenting the video stream into a backgroundand a foreground, wherein, subsequent to the segmentation, the object isdetermined to belong to background or the foreground.

Masking an object in the video stream is to pixelate or in other wayscover or black out the pixels that are desirable to mask.

In one embodiment, the computational complexity of the first classifieris lower than the computational complexity of the second classifier.

This advantageously provides for a first classifier that is faster thanthe second classifier. A fast classifier may be less accurate than aslow classifier. However, in order to detect a fast-moving object in theforeground, a faster classifier is preferred despite somewhat loweraccuracy. Especially since for privacy purposes a certain amount offalse positives is acceptable. A size of a neural network of the firstclassifier may be smaller than the size of a neural network of thesecond classifier, if the classifiers are neural networks.

In one embodiment, the second classifier may be configured to performclassification on fewer frames per time unit of the video stream thanthat of the first classifier. Since the second classifier is used forclassifying objects in the background segment of the video stream wherestatic objects are detected there is no need for a high frame rate. Inother words, static objects do not move and thus it is sufficient with alower frame rate for detecting object in the background. To thecontrary, in the foreground segment where moving objects are expected, ahigher frame rate is needed. Thus, a slower but more accurateclassification can be performed by the second classifier, and a fast butless accurate classification is performed by the first classifier. Thisis one advantageous way of tailoring the classifiers for their specifictask of object classification in the same video stream but in differentsegments.

In one embodiment, the second classifier may be configured to performclassification only on nonconsecutive time frames of the video stream.Advantageously, since only static objects are expected to be classifiedby the second classifier, there is no need to perform classification onevery frame. To enable the use of a more accurate classifier that needfor processing time, only nonconsecutive time frames, preferablyoccurring at regular time intervals of the video stream may beclassified by the second classifier. Such nonconsecutive time frames maybe for example every 5th, 10th, 15th, 20th, or 25th time frame.

In one embodiment, the first classifier may be configured to classifymoving objects and the second classifier being configured to classifystatic objects. Thus, the first classifier may have been trained usingonly video streams with moving objects and the second classifier mayhave been trained using video streams with only static objects.

A neural network provides for an efficient tool for classification.Various types of neural networks adapted to perform classification areconceivable and known per se. Example suitable neural networks are arecurrent neural network and a convolutional neural network. A recurrentneural network is especially efficient for capturing temporalevolutions.

Further, other suitable classifiers may be decision tree classifierssuch as random forest classifiers that are efficient for classification.In addition, classifiers such as support vector machine classifiers andlogistic regression classifiers are also conceivable.

In addition, the classifier may be a statistical classifier, a heuristicclassifier, a fuzzy logic classifier. Further, it is also feasible touse a table, i.e., a look-up table with combinations of data.

According to a second aspect, there is provided a method for masking ofobjects in a video stream, the method comprising the following steps:acquiring a video stream; detecting an object in the video stream;determining whether the detected object belongs to a foreground of thevideo stream indicative of moving objects or a background of the videostream indicative of static objects; classifying the detected object tobe of a specific type using a lower classification threshold if thedetected object is determined to belong to the foreground, than if theobject is determined to belong to the background, if the detected objectis classified as being of the specific type of object, masking theobject in the video stream.

This second aspect uses different thresholds in the classifier dependingon whether the object belongs to the foreground or background of thevideo stream. The foreground is the part or segment of the video streamthat comprises the moving objects and the background is the part orsegment of the video stream that comprises the static object. By theprovision of a lower threshold for what is acceptable as an object ofthe specific type provides for reducing the amount of objects of thespecific type that are not masked, although the amount of falsepositives may increase. For a privacy critical scene this is not anissue. It is more important that all objects of the specific type aremasked. For the background segment, the threshold is maintained highersince the background region of static objects are easier to classifywithin. Lowering the classification threshold in the foreground segmentincreases the probability of correctly classifying all the objects ofthe specific type even if it is moving fast.

The method may comprise a step of segmenting the video stream into abackground and a foreground, i.e., into a background segment and aforeground segment. Such segmentation may be performed by extracting thepixel data from pixels in each frame of the video stream that indicatesmoving objects and use that data to construct the foreground. Pixel datafrom pixels in each frame of the video stream that indicates staticobjects are used for constructing the background.

Subsequent to the segmentation it may be determined whether the objectbelongs to the background segment or to the foreground segment, i.e.,whether the object is found or detected in the background segment or inthe foreground segment.

In embodiments, the method may comprise: if the detected object isdetermined to belong to the foreground, determining the speed of thedetected object; and selecting a classification threshold depending onthe speed of the detected object, and wherein the detected object isclassified using the selected classification threshold. In this way, thethreshold may be tailored to the speed of the object so that anappropriate threshold is used. The threshold should be selected so thatthe specific type of object is correctly classified with low levels ofmissed classifications, i.e., false negatives to ensure that even if theobject is moving very fast, a specific type of object is detected andclassified.

In one example embodiment, the threshold may be selected by thefollowing procedure. If the speed of the object exceeds a speedthreshold, classifying the object using a classifier with a firstclassification threshold, and if the speed of the object is below thespeed threshold, classifying the object using a the classifier with asecond classification threshold that is higher than the firstclassification threshold. This advantageously provides a straightforwardspeed thresholding for selecting the classification threshold. The speedthreshold may be fixed.

In one possible embodiment, a speed exceeding the speed thresholdindicates that the object is moving and a speed below the speedthreshold indicates a static object. In other words, the speed thresholdmay be zero.

In some embodiments, the classification threshold is a function of theobject speed. In other words, instead of a fixed threshold, thethreshold is selected as a function of the object speed, e.g., as asliding threshold that is adaptively set. This advantageously providesfor more accurately set thresholds and consequently to improvedclassification results.

In embodiments, the method may comprise classifying objects in theforeground set of frames and in the background set of frames, andmasking each object classified as being of the specific type of object.In other words, it should be ensured that all classified objects of thespecific type in both the foreground and in the background are masked inorder to ensure privacy.

In some possible implementations, the specific type of object may be avehicle.

According to a third aspect, there is provided a control unit configuredto perform the steps of any one of the herein described aspects andembodiments.

Further embodiments of, and effects obtained through this third aspectof the present disclosure are largely analogous to those described abovefor the first aspect and the second aspect.

According to a fourth aspect, there is provided a system comprising animage capturing device configured to capture a video stream, and acontrol unit according to the third aspect.

Further embodiments of, and effects obtained through this fourth aspectare largely analogous to those described above for the first aspect, thesecond aspect, and the third aspect.

According to a fifth aspect, there is provided computer programcomprising instructions which, when the program is executed by acomputer, cause the computer to carry out the method of any of theherein discussed embodiments.

Further embodiments of, and effects obtained through this fifth aspectof the present disclosure are largely analogous to those described abovefor the other aspects.

Further features of, and advantages with, the present disclosure willbecome apparent when studying the appended claims and the followingdescription. The skilled addressee realize that different features ofthe present disclosure may be combined to create embodiments other thanthose described in the following, without departing from the scope ofthe present disclosure.

BRIEF DESCRIPTION OF THE DRAWINGS

The various aspects of the disclosure, including its particular featuresand advantages, will be readily understood from the following detaileddescription and the accompanying drawings, in which:

FIG. 1 conceptually illustrates a scene being monitored by an imagecapturing device as an example application of certain embodiments;

FIG. 2 conceptually illustrates segmentation into background andforeground segments according to certain embodiments;

FIG. 3 is a flow-chart of method steps according to certain;

FIG. 4 conceptually illustrates a stream of frames of a video stream;

FIG. 5 is a flow-chart of method steps according to certain embodiments;

FIG. 6 is a flow-chart of method steps according to certain embodiments;

FIG. 7 is a flow-chart of method steps according to certain embodiments;and

FIG. 8 is a block diagram of system according to certain.

DETAILED DESCRIPTION

The present concepts will now be described more fully hereinafter withreference to the accompanying drawings, in which currently preferredembodiments are shown. The concepts may, however, be embodied in manydifferent forms and should not be construed as limited to theembodiments set forth herein; rather, these embodiments are provided forthoroughness and completeness, and fully convey the scope of theconcepts to the skilled person. Like reference characters refer to likeelements throughout.

Turning now to the drawings and to FIG. 1 in particular, there is showna scene 1 being monitored by an image capturing device 100, e.g., acamera or more specifically a surveillance camera. In the scene 1, thereis a moving object 102 and a set of static objects 104 a, 104 b, and 104c. The moving object 102 may be vehicle driving on a road 106 and atleast one of the static objects, e.g., 104 a is a vehicle that is parkednext to the road 106.

The image capturing device 100 is continuously monitoring the scene 1 bycapturing a video stream of the scene and the objects therein. Someobjects, such as a vehicle 104 a, and in particular their licenseplates, are desirable to mask so that they are not visible in the outputvideo stream. For this, it is necessary to detect objects in the sceneand classifying them to be of a specific type, e.g., a vehicle, so thatthey can be masked.

Detecting and classifying a static object ensues different challengescompared to classifying moving objects. A fast-moving object 102 may bedifficult to accurately detect and classify because it only stays in thescene 1 for a limited period of time. To alleviate this problem, thesystem conducts classifications with different properties depending onwhether the background of static objects is considered or if theforeground of moving objects are considered.

Turning to FIG. 2 , the scene 1 is represented by an exampleaccumulation of two or more frames 202 where the moving object 102 hasmoved. Each frame of the video stream is split or segmented into aforeground 204 indicative of the moving object, e.g., the vehicle 102,and into a background 206 indicative of the static objects 104 a-c.

Segmentation into foreground and background may be performed by e.g.,analyzing the evaluation of the captured scene in the video stream andif movement is detected between two frames, the relevant regions of theframes are tagged as foreground. Regions of the frames where no movementis detected are tagged as background. Segmentation may be performed invarious ways and can generally be performed based on many featuresrelated to images, such as color, intensity, region-based segmentation.Some examples are now only briefly described.

For example, segmentation may be based on motion vectors, where areas inthe frames of the video stream with motion-vectors with magnitudeslarger than a certain magnitude fall into the foreground segment andremaining areas fall into the background segment.

Segmentation may be based on pixel value difference, e.g., differencesin pixel intensity and color may be used for segmentation.

FIG. 3 is a flow-chart of method steps according to a first fordetecting, classifying and masking of objects in a video stream.

In step S102 a video stream is acquired. This may be performed by theimage capturing device 100, in other words, the image capturing deviceacquires a video stream of the scene 1 comprising moving 102 and staticobjects 104 a-c.

In step S104 the moving object 102, and objects 104 a-c is detected inthe video stream. This detection may be performed prior to or subsequentto a segmentation or splitting of the video stream 202 into thebackground 206 and the foreground 204.

In step S106 it is determined whether the detected object belongs to aforeground 204 of the video stream 202 indicative of moving objects 102or a background 206 of the video stream 202 indicative of static objects104 a-c. Such determination may be performed by evaluating whether theobjects moves or not. A moving object 102 generally belongs to theforeground and a static object 104 a-c belongs to the background.However, it should be noted that the terms “foreground” and “background”are used only for convenience. Other terms may be applied, such as firstand second groups, static and mobile groups, or fast-moving andslow-moving groups.

Further, the video stream may be segmented into a background and aforeground, wherein, after the segmentation, the object is determined tobelong to the background or to the foreground. Thus, the video streammay be split into the background 206 and into the foreground 204, and,depending in which segment, the background 206 or foreground 204, theobject is detected, it can be concluded whether the object belongs tothe background 206 or to the foreground 204.

In steps S108 a-b, the detected object is classified to be of a specifictype using a first classifier, step S108 a, if the detected object isdetermined to belong to the foreground, and using a second classifier,step S108 b, if the detected object is determined to belong to thebackground. The first classifier is different from the secondclassifier.

The specific type may be that the object is a vehicle such as e.g., acar, a truck, a boat, a motorcycle. The specific type may additionallyor alternatively be that the object is a person.

The difference between the classifiers may be of different nature,however, with the main (though not only) objective that the firstclassifier should classify moving objects and the second classifiershould classify static objects.

In step S110, if the detected object in either one of the foreground orbackground is classified as being of the specific type of object theobject is masked in the video stream. Thus, in the output video stream,objects classified as being of the specific type are masked. Forexample, if the object 104 a is classified as vehicle by the secondclassifier, the vehicle 104 a is masked in step S110, and if the movingobject 102 is classified as vehicle by the first classifier, the vehicle102 is masked in step S110.

The first classifier is different from the second classifier. Forexample, the computational complexity of the first classifier is lowerthan the computational complexity of the second classifier. Thisprovides the advantage that the first classifier may process the datafrom the video stream faster such that moving objects can be classifiedat the cost of less accurate classifications.

The video stream is a stream of frames, as is often the case in videoprocessing. FIG. 4 conceptually illustrates a video stream as conceptualconsecutive frames 400. To take advantage of the different requirementsof the classifiers, the second classifier may be configured to performclassification on fewer frames per time unit of the video stream thanthat of the of the first classifier. For example, the second classifiermay be configured to perform classification only on nonconsecutive timeframes 402 of the video stream. In other words, objects in thebackground 206 is classified only in nonconsecutive time frames 402whereas objects in the foreground are classified using the full set offrames 400. The nonconsecutive times frames 402 occur at regular timeintervals separated by a fixed time duration or separated by a fixednumber of intermediate time frames such as the nonconsecutive timesframes 402 are for example every 5^(th), 10^(th), 15^(th), 20^(th), or25^(th) time frame.

Since the second classifier is expected to classify only static objects,there is no need for high temporal density data, e.g., the full set offrames 400. In contrast, since the first classifier is expected toclassify moving objects, it is advantageous to use video data withhigher temporal density, such as the full set of frames 400, than forthe second classifier where only nonconsecutive times frames 402 aresufficient.

Further, the first classifier may be specifically configured to classifymoving objects and the second classifier may be specifically configuredto classify static objects. For example, the first classifier may havebeen trained using image data of moving objects whereas the secondclassifier may have been trained using image data of static objects.

FIG. 5 is a flow-chart of method steps according to a second aspect fordetecting, classifying and masking of objects in a video stream. Themethod of this second aspect is based on the same insight as that of thefirst aspect described with reference to FIG. 3 and thus belong to thesame concept.

In step S102 a video stream is acquired. This may be performed by theimage capturing device 100, in other words, the image capturing deviceacquires a video stream of the scene 1 comprising moving 102 and staticobjects 104 a-c. Step S102 of FIG. 5 is performed in the same way asstep S102 of FIG. 3 .

In step S104 a moving object 102, and objects 104 a-c is detected in thevideo stream. This detection may be performed prior to or subsequent toa segmentation or splitting of the video stream 202 into the background206 and the foreground 204.

In step S106 it is determined whether the detected object belongs to aforeground 204 of the video stream 202 indicative of moving objects 102or a background 206 of the video stream 202 indicative of static objects104 a-c. Such determination may be performed by evaluating whether theobjects moves or not. A moving object generally belongs to theforeground and a static object belongs to the background. Step S106 ofFIG. 5 is performed in the same way as step S106 of FIG. 3 ._([JH1])

In step S208 a-b, the detected object is classified to be of a specifictype using a lower, first classification threshold if the detectedobject is determined to belong to the foreground, step S208 a, than ifthe object is determined to belong to the background, step S208 b, wherea second classification threshold is used. The first classificationthreshold is lower than the second classification threshold.

In step S110, if the detected object in either one of the foreground orbackground is classified as being of the specific type of object theobject is masked in the video stream. Thus, in the output video stream,objects classified as being of the specific type are masked. Forexample, if the object 104 a is classified as vehicle using the secondclassification threshold, the vehicle 104 a is masked in step S110, andif the moving object 102 is classified as vehicle using the firstclassification threshold, the vehicle 102 is masked in step S110. StepS110 of FIG. 5 is performed in the same way as step S110 of FIG. 3 .

A moving object 102 is more difficult, or computationally costly, todetect and classify. Therefore, the first classification threshold for adetected object to be of a specific type in the foreground 204 is setrelatively low. An object 104 a-c that is not moving is easier to detectand classify. Therefore, a relatively high classification threshold canbe used that a detected object is of a specific type if the object isknown to be static. Based on this insight, the first classificationthreshold used in the foreground 204 is lower than the secondclassification threshold used in the background 206 of the video stream.

With reference to FIG. 6 , if the detected object is determined tobelong to the foreground in step S106, the speed of the detected objectis determined in step S204. The speed of the object may be determined byanalyzing consecutive frames in the video stream or by other known meansin the art.

In step S206 is a classification threshold selected depending on thespeed of the detected object. The detected object is classified usingthe selected classification threshold in step S208 a as discussed inrelation to FIG. 5 .

Similarly, in the case of different classifiers described with referenceto FIG. 3 , and now with reference to FIG. 7 , if the detected object isdetermined to belong to the foreground in step S106, the speed of thedetected object is determined in step S204.

The speed of the object may be determined by analyzing consecutiveframes in the video stream or by other known means in the art.

In step S206 a classification threshold is selected depending on thespeed of the detected object. The detected object is classified in stepS108 a using the selected classification threshold and the firstclassifier as discussed in relation to FIG. 3 .

The classification threshold may be set and tuned depending on theapplication at hand. It may for example be possible to use a fixedthreshold, thus, if the speed of the moving object 102 exceeds a speedthreshold, the object is classified using a classifier with the firstclassification threshold. However, if the speed of the moving object 102is below the speed threshold, the object is classified using theclassifier with a second classification threshold that is higher thanthe first classification threshold.

In some possible implementations, a speed exceeding the speed thresholdindicates that the object 102 is moving and a speed below the speedthreshold indicates a static object 104 a-c.

The classification threshold may be a function of the object speed, aso-called sliding threshold. Thus, a predetermined function may be usedwhere the object speed is used as input, and the output is the selectedclassification threshold. For example, a change in object speed mayresult in a proportional change in selected classification threshold.

All objects classified as being of the specific type, such as a vehiclecomprising a license plate, whether being in the foreground set offrames or in the background set of frames, are masked.

The classifiers discussed herein may operate different types ofclassifiers. For example, a classifier neural network may be used thatis adapted to perform the classifying step. Various types of neuralnetworks adapted to perform classification is conceivable and known perse. Example suitable neural networks are convolutional neural networks,that may or may not have recursive features. Other suitable classifiersmay be decision tree classifiers such as random forest classifiers. Inaddition, classifiers such as support vector machine classifiers,logistic regression classifiers, heuristic classifiers, fuzzy logicclassifiers, statistical classifiers, or look-up tables are alsoconceivable to be used in the classifier.

The classifier provides an output indicating the outcome of theclassifying step, for example whether an object is of the specific typewith some probability provided by the classification threshold.

The classification thresholds may tuneable to a specific classifier. Theclassification thresholds may be empirically determined thresholdvalues.

FIG. 8 is a block-diagram of a system 800 according to certainembodiments. The system 800 comprising an image capturing device 100configured to capture a video stream, and a control unit 802 configuredto perform any one of the methods described in relation to FIGS. 3-7 .The output being the video stream with the objects of the specific typemasked.

The control unit includes a microprocessor, microcontroller,programmable digital signal processor or another programmable device.The control unit may also, or instead, include an application specificintegrated circuit, a programmable gate array or programmable arraylogic, a programmable logic device, or a digital signal processor. Wherethe control unit includes a programmable device such as themicroprocessor, microcontroller or programmable digital signal processormentioned above, the processor may further include computer executablecode that controls operation of the programmable device.

The control functionality of the present disclosure may be implementedusing existing computer processors, or by a special purpose computerprocessor for an appropriate system, incorporated for this or anotherpurpose, or by a hardwire system. Embodiments within the scope of thepresent disclosure include program products comprising machine-readablemedium for carrying or having machine-executable instructions or datastructures stored thereon. Such machine-readable media can be anyavailable media that can be accessed by a general purpose or specialpurpose computer or other machine with a processor. By way of example,such machine-readable media can comprise RAM, ROM, EPROM, EEPROM, CD-ROMor other optical disk storage, magnetic disk storage or other magneticstorage devices, or any other medium which can be used to carry or storedesired program code in the form of machine-executable instructions ordata structures and which can be accessed by a general purpose orspecial purpose computer or other machine with a processor. Wheninformation is transferred or provided over a network or anothercommunications connection (either hardwired, wireless, or a combinationof hardwired or wireless) to a machine, the machine properly views theconnection as a machine-readable medium. Thus, any such connection isproperly termed a machine-readable medium. Combinations of the above arealso included within the scope of machine-readable media.Machine-executable instructions include, for example, instructions anddata which cause a general-purpose computer, special purpose computer,or special purpose processing machines to perform a certain function orgroup of functions.

Although the figures may show a sequence the order of the steps maydiffer from what is depicted. Also, two or more steps may be performedconcurrently or with partial concurrence. Such variation will depend onthe software and hardware systems chosen and on designer choice. Allsuch variations are within the scope of the disclosure. Likewise,software implementations could be accomplished with standard programmingtechniques with rule-based logic and other logic to accomplish thevarious connection steps, processing steps, comparison steps anddecision steps. Additionally, even though the concepts have describedwith reference to specific exemplifying embodiments thereof, manydifferent alterations, modifications and the like will become apparentfor those skilled in the art.

In addition, variations to the disclosed embodiments can be understoodand effected by the skilled addressee in practicing the concepts, from astudy of the drawings, the disclosure, and the appended claims.Furthermore, in the claims, the word “comprising” does not exclude otherelements or steps, and the indefinite article “a” or “an” does notexclude a plurality.

1. A method for masking of objects in a video stream, the methodcomprising: acquiring a video stream; detecting an object in the videostream; determining whether the detected object belongs to a foregroundof the video stream indicative of moving objects or to a background ofthe video stream indicative of static objects; classifying the detectedobject to be of a specific type using a first classifier if the detectedobject is determined to belong to the foreground, and using a secondclassifier if the detected object is determined to belong to thebackground, the first classifier being configured to classify movingobjects and the second classifier being configured to classify staticobjects, and if the detected object is classified as being of thespecific type of object, masking the object in the video stream.
 2. Themethod according to claim 1, wherein the computational complexity of thefirst classifier is lower than the computational complexity of thesecond classifier such that the first classifier process data from thevideo stream faster and with less accuracy than the second classifier.3. The method according to claim 1, the second classifier beingconfigured to perform classification on fewer frames per time unit ofthe video stream than that of the first classifier.
 4. The methodaccording to claim 1, the second classifier being configured to performclassification only on nonconsecutive time frames of the video stream.5. The method according to claim 1, further comprising: if the detectedobject is determined to belong to the foreground, determining the speedof the detected object; and selecting a classification thresholddepending on the speed of the detected object, and wherein the detectedobject is classified using the selected classification threshold,wherein, if the speed of the object exceeds a speed threshold,classifying the object using a classifier with a first classificationthreshold, and if the speed of the object is below the speed threshold,classifying the object using the classifier with a second classificationthreshold that is higher than the first classification threshold.
 6. Themethod according to claim 5, wherein a speed exceeding the speedthreshold indicates that the object is moving and a speed below thespeed threshold indicates a static object.
 7. The method according toclaim 5, wherein the classification threshold is a function of theobject speed.
 8. The method according to claim 1, further comprisingclassifying objects in the foreground set of frames and in thebackground set of frames, and masking each object classified as being ofthe specific type of object.
 9. The method according to claim 1, furthercomprising: segmenting the video stream into a background and aforeground, wherein, subsequent to the segmentation, the object isdetermined to belong to the background or to the foreground.
 10. Amethod for masking of objects in a video stream, the method comprising:acquiring a video stream; detecting an object in the video stream;determining whether the detected object belongs to a first portion ofthe video stream indicative of moving objects or a second portion of thevideo stream indicative of static objects; classifying the detectedobject to be of a specific type using a lower classification thresholdif the detected object is determined to belong to the first portion,than if the object is determined to belong to the second portion, if thedetected object is classified as being of the specific type of object,masking the object in the video stream.
 11. The method according toclaim 10, further comprising: if the detected object is determined tobelong to the first portion, determining the speed of the detectedobject; and selecting a classification threshold depending on the speedof the detected object, and wherein the detected object is classifiedusing the selected classification threshold, wherein, if the speed ofthe object exceeds a speed threshold, classifying the object using aclassifier with a first classification threshold, and if the speed ofthe object is below the speed threshold, classifying the object usingthe classifier with a second classification threshold that is higherthan the first classification threshold.
 12. The method according toclaim 11, wherein a speed exceeding the speed threshold indicates thatthe object is moving and a speed below the speed threshold indicates astatic object.
 13. The method according to claim 11, wherein theclassification threshold is a function of the object speed.
 14. Themethod according to claim 10, further comprising classifying objects inthe first portion set of frames and in the second portion set of frames,and masking each object classified as being of the specific type ofobject.
 15. The method according to claim 10, further comprising:segmenting the video stream into a second portion and a first portion,wherein, subsequent to the segmentation, the object is determined tobelong to the second portion or to the first portion.
 16. Anon-transitory computer-readable storage medium having stored thereoninstructions for implementing a method for masking of objects in a videostream, when executed on a device having processing capabilities; themethod comprising: acquiring a video stream; detecting an object in thevideo stream; determining whether the detected object belongs to aforeground of the video stream indicative of moving objects or to abackground of the video stream indicative of static objects; classifyingthe detected object to be of a specific type using a first classifier ifthe detected object is determined to belong to the foreground, and usinga second classifier if the detected object is determined to belong tothe background, the first classifier being configured to classify movingobjects and the second classifier being configured to classify staticobjects, and if the detected object is classified as being of thespecific type of object, masking the object in the video stream.
 17. Anon-transitory computer-readable storage medium having stored thereoninstructions for implementing the method for masking of objects in avideo stream, when executed on a device having processing capabilities,the method comprising: acquiring a video stream; detecting an object inthe video stream; determining whether the detected object belongs to aforeground first portion of the video stream indicative of movingobjects or a background second portion of the video stream indicative ofstatic objects; classifying the detected object to be of a specific typeusing a lower classification threshold if the detected object isdetermined to belong to the foreground first portion, than if the objectis determined to belong to the background second portion, if thedetected object is classified as being of the specific type of object,masking the object in the video stream.